﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;

namespace NMoq.Core.UnitTest
{
    public class MockSection:SerializableConfigurationSection
    {
        public const string SectionName ="mock";

        private const string NameProperty = "Name";
        private const string CurrentStrategyProperty = "currentStrategy";
        private const string MockContainerProperty = "mockContainer";

        public static MockSection GetMockSection(IConfigurationSource configurationSource)
        {
            return (MockSection)configurationSource.GetSection(SectionName);
        }

        [ConfigurationProperty(NameProperty,IsRequired=false  )]
        public string Name
        {
            get
            {
                return (string)this[NameProperty] ;
            }
            set
            {
                this[NameProperty] = value;
            }
        }

        [ConfigurationProperty(CurrentStrategyProperty ,IsRequired =false )]
        public StrategyData CurrentStrategy
        {
            get
            {
                return (StrategyData)this[CurrentStrategyProperty];
            }
            set
            {
                this[CurrentStrategyProperty] = value;
            }
        }

        [ConfigurationProperty (MockContainerProperty ,IsRequired=false )]
        public MockContainerData MockContainer
        {
            get
            {
                return (MockContainerData )this[MockContainerProperty ];
            }
            set
            {
                this[MockContainerProperty] = value;
            }
        }
    }
}
